<template>
  <view class="work-page">
    <view class="btn-delete">
      <up-button text="删除" shape="circle" icon="trash" color="#F2F2F2" @click="modalShow = true"></up-button>
    </view>
    <view class="work-content">
      <image src="https://img.js.design/assets/img/66c4605be6fc3110ca4c89f5.png#77b4d311506bb9a28f8b84cd3a9c9f5f"
        mode="widthFix"></image>
      <view class="work-label">*定制效果图仅供参考，以实际实物为主</view>
      <view class="work-price">￥199</view>
      <view class="work-text">作品文案作品文案作品文案作品文案作品文案作品文案作品文案作品文案</view>
    </view>
    <view class="work-btn">
      <view class="btn-edit">编辑作品</view>
      <view class="btn-buy" @click="onPay">购买</view>
    </view>
  </view>
  <up-modal :show="modalShow" :title="modalTitle" :content='modalContent' confirmColor="#FF416C" showCancelButton contentTextAlign="center"
    @cancel="modalShow = false" @confirm="onModalConfirm"></up-modal>

</template>

<script setup>
  import {
    ref
  } from 'vue'
  const modalShow = ref(false)
  const modalTitle = ref('提示')
  const modalContent = ref('确定删除本作品')

  function onModalConfirm(e) {
  console.log(e,4444)
  }
  
  function onPay(){
    uni.navigateTo({
      url:"/subpages/userPage/product-order"
    })
  }
</script>

<style lang="less" scoped>
  .work-page {
    height: 100%;
    display: flex;
    background-color: #fff;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    padding: 0 64rpx 40rpx 64rpx;

    .btn-delete {
      position: absolute;
      top: 24rpx;
      right: 32rpx;
      width: 160rpx;
      z-index: 1;

      /deep/ .u-button--circle {
        color: #333333 !important;
      }
    }

    .work-content {
      margin-top: 126rpx;
      display: flex;
      align-items: center;
      flex-direction: column;

      .work-label {
        font-size: 24rpx;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        margin-top: 24rpx;
      }

      .work-price {
        font-size: 56rpx;
        font-weight: 400;
        color: rgba(255, 65, 108, 1);
        margin-top: 48rpx;
      }

      .work-text {
        font-size: 32rpx;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
        margin-top: 20rpx;
        text-align: center;
      }

      image {
        width: 528rpx;
        height: 528rpx;
      }
    }

    .work-btn {
      width: 100%;
      display: flex;
      flex-direction: column;
      margin-top: 42rpx;

      .btn-edit {
        width: 100%;
        height: 96rpx;
        border-radius: 114rpx;
        background: #F2F2F2;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 96rpx;
        color: rgba(51, 51, 51, 1);
        text-align: center;

      }

      .btn-buy {
        width: 100%;
        height: 96rpx;
        border-radius: 114rpx;
        background: #FF416C;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 96rpx;
        color: rgba(255, 255, 255, 1);
        text-align: center;
        margin-top: 20rpx;
      }
    }
  }
</style>